package com.aier.bean.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 全局状态码
 */
public enum GlobalCode {
    REQUEST_SUCCESS("0000","请求成功"),
    REQUEST_FAIL("0001","请求失败"),

    UPDATE_SALESPERSON_FAIL("1001","修改业务员名字失败"),
    UPDATE_INVENTORY_TAB_FAIL("1002","更新初始库存 内存表失败"),
    SALESPERSON_NOT_RESPONSIBLE("1003","修改业务员信息失败，原因是该业务员原本不负责该商品"),

    ENTER_INVENTORY_FAIL("2001","库存录入失败"),
    ENTER_PRODUCT_FAIL("2002","商品录入失败"),

    READ_INVENTORY_FAIL("3001","获取库存信息失败"),
    READ_ALL_MODEL_NAME_FAIL("3002","获取所有型号列表失败"),
    READ_ALL_SALESPERSON_NAME_FAIL("3003","获取所有业务员姓名列表失败"),
    GET_ALL_PURCHASE_FAIL("3101","获取所有采购信息失败"),
    GET_GOODS_ARRIVED_BY_CONTRACT_CODE_FAIL("3102","根据合同编号获取到货信息失败"),

    BUILD_TABLE_FAIL("4001","构建库存记录表失败"),

    SAVE_PRODUCT_FAIL("5001","插入商品录入信息失败"),
    SAVE_INVENTORY_FAIL("5002","插入商品库存信息失败"),
    NOT_INVENTORY("5003","插入商品录入信息失败，因为该商品没有库存信息"),
    SAVE_PURCHASE_FAIL("5101","插入采购信息失败"),
    SAVE_GOODS_ARRIVED_FAIL("5201","插入到货信息失败"),


    CONTRACT_CODE_IS_EXIST("6101","采购表中已存在该订单编号"),
    CONTRACT_CODE_NOT_EXIST("6103","采购表不存在该订单编号，请先录入采购信息"),

    CONTRACT_CODE_AND_MODEL_NAME_NOT_EXIST("7100","采购表不同时存在合同单编号和型号"),


    INVENTORY_IS_EXIST("6001","插入库存信息表的型号已经存在"),


    OPERATE_TYPE_FAIL("7001","操作方向输入不合法"),

    ;

    private String code;
    private String message;

    GlobalCode(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override public String toString() {
        return "TestCode{" + "code='" + code + '\'' + ", message='" + message + '\'' + '}';
    }
}
